import request from '@/utils/request'

// 查询变更令申报列表
export function listChange(query) {
  return request({
    url: '/engineering/change/list',
    method: 'get',
    params: query
  })
}

// 查询变更令申报详细
export function getChange(changeId) {
  return request({
    url: '/engineering/change/' + changeId,
    method: 'get'
  })
}

// 新增变更令申报
export function addChange(data) {
  return request({
    url: '/engineering/change',
    method: 'post',
    data: data
  })
}

// 修改变更令申报
export function updateChange(data) {
  return request({
    url: '/engineering/change',
    method: 'put',
    data: data
  })
}

// 删除变更令申报
export function delChange(changeId) {
  return request({
    url: '/engineering/change/' + changeId,
    method: 'delete'
  })
}

// 传送变更令申报
export function deliveryChange(data) {
  return request({
    url: '/engineering/change/delivery',
    method: 'post',
    data: data
  })
}

// 锁定变更令申报
export function lockChange(changeId) {
  return request({
    url: '/engineering/change/lock/' + changeId,
    method: 'get'
  })
}

// 解锁变更令申报
export function unLockChange(changeId) {
  return request({
    url: '/engineering/change/unlock/' + changeId,
    method: 'get'
  })
}

// 工程计量添加前的验证
export function beforeAddValidate() {
  return request({
    url: '/engineering/meterage/validateBeforeMeterageIsWorkflowUser',
    method: 'get'
  })
}
